home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Bus / D-E / drawings sheet (.txt) < prev    next >
Encoding:
Wingz Spreadsheet  |  1991-09-07  |  7.8 KB  |  195 lines  |  [WZSS/WNGZ]

  1. drawings sheet
  2. WZSSWNGZ
  3. WNGZWZSS01b1
  4. Geneva
  5. Geneva
  6. Chicago
  7. Chicago
  8. This sheet shows a Custom Button with a Control Script.  When you click on the button, the script uses Draw commands to draw rectangles, ovals, pies and polygons with different line  sizes, colors and patterns.  To view the script, select the Custom Button with the Object Tool and  go to the Script Menu, under Control Script.  For more information about the Draw commands, please refer to the Reference Guide on page 165.
  9. Chicago
  10. draw_box
  11. draw_oval
  12. draw_piez
  13. draw_polygon
  14. draw_spline
  15. {This script demonstrates the use of the Draw commands.  The variables (x0,y0,x1,y1) are the
  16.  coordinates for the objects that will  be drawn.  
  17.  The function rand() is used to produce a random number between 0 and 1 for the coordinates.
  18.  The function uniform() is also used to produce a random number between 0 and the number specified.
  19.  The Frame command (i.e. Frame Rectangle) determines the current line style for the object.  
  20.  The Fill command (i.e. Fill Rectangle determines the current brush color.  The Paint command 
  21.  (i.e. Paint Rectangle) determines both the line style and the brush color.  
  22.  More information about the draw commands can be found in the Wingz Reference Guide, on page 165.}
  23. repaint object 1
  24. function draw_box()
  25.     define x0, y0, x1, y1, t
  26.     x0 = rand()
  27.     y0 = rand()
  28.     x1 = rand()
  29.     y1 = rand()
  30.     if x0 > x1
  31.     t = x0
  32.     x0 = x1
  33.     x1 = t
  34.     end if
  35.     if y0 > y1
  36.     t = y0
  37.     y0 = y1
  38.     y1 = t
  39.     end if
  40.     case round(uniform(5),0)
  41.         when 0
  42.           frame rectangle (x0, y0) (x1, y1)
  43.         when 1
  44.           fill rectangle (x0, y0) (x1, y1)
  45.         when 2
  46.           paint rectangle (x0, y0) (x1, y1)
  47.         when 3
  48.           frame round rectangle (x0, y0) (x1, y1)
  49.         when 4
  50.           fill round rectangle (x0, y0) (x1, y1)
  51.         when 5
  52.           paint round rectangle (x0, y0) (x1, y1)
  53.     end case
  54. end function
  55. function draw_oval()
  56.     define x0, y0, x1, y1, t
  57.     x0 = rand()
  58.     y0 = rand()
  59.     x1 = rand()
  60.     y1 = rand()
  61.     if x0 > x1
  62.     t = x0
  63.     x0 = x1
  64.     x1 = t
  65.     end if
  66.     if y0 > y1
  67.     t = y0
  68.     y0 = y1
  69.     y1 = t
  70.     end if
  71.     case round(uniform(2),0)
  72.         when 0
  73.           frame oval (x0, y0) (x1, y1)
  74.         when 1
  75.           fill oval (x0, y0) (x1, y1)
  76.         when 2
  77.           paint oval (x0, y0) (x1, y1)
  78.     end case
  79. end function
  80. function draw_pie()
  81.     define x0, y0, x1, y1, t
  82.     x0 = rand()
  83.     y0 = rand()
  84.     x1 = rand()
  85.     y1 = rand()
  86.     if x0 > x1
  87.     t = x0
  88.     x0 = x1
  89.     x1 = t
  90.     end if
  91.     if y0 > y1
  92.     t = y0
  93.     y0 = y1
  94.     y1 = t
  95.     end if
  96.     case round(uniform(2),0)
  97.         when 0
  98.           frame pie (x0, y0) (x1, y1)
  99.             uniform(360) for uniform(360)
  100.         when 1
  101.           fill pie (x0, y0) (x1, y1)
  102.             uniform(360) for uniform(360)
  103.         when 2
  104.           paint pie (x0, y0) (x1, y1)
  105.             uniform(360) for uniform(360)
  106.     end case
  107. end function
  108. function draw_polygon()
  109.     define x0, y0, i
  110.     x0 = rand()
  111.     y0 = rand()
  112.     open polygon
  113.         move (x0, y0)
  114.         for i = 1 to 5
  115.           draw (rand(), rand())
  116.         end for
  117.         draw (x0, y0)
  118.     close polygon
  119.     case round(uniform(2),0)
  120.         when 0
  121.          frame polygon
  122.         when 1
  123.           fill polygon
  124.         when 2
  125.           paint polygon
  126.     end case
  127.     kill polygon
  128. end function
  129. function draw_spline()
  130.     define x0, y0, x1, y1, x2, y2, i
  131.     x0 = rand()
  132.     y0 = rand()
  133.     x1 = rand()
  134.     y1 = rand()
  135.     x2 = rand()
  136.     y2 = rand()
  137.     open polygon
  138.         load spline (x0, y0)
  139.         load spline (x1, y1)
  140.         load spline (x2, y2)
  141.         for i = 1 to 5
  142.           draw spline (rand(), rand())
  143.         end for
  144.         draw spline (x0, y0)
  145.         draw spline (x1, y1)
  146.         draw spline (x2, y2)
  147.     close polygon
  148.     case round(uniform(2),0)
  149.         when 0
  150.           frame polygon
  151.         when 1
  152.           fill polygon
  153.         when 2
  154.           paint polygon
  155.     end case
  156.     kill polygon
  157. end function
  158. on repaint
  159.     define i
  160.     for i = 1 to 5
  161.         fill pattern uniform(38)
  162.         fill fg rgb(uniform(255), uniform(255), uniform(255))
  163.         fill bg rgb(uniform(255), uniform(255), uniform(255))
  164.         line width uniform(10) points
  165.         line pattern uniform(38)
  166.         line fg rgb(uniform(255), uniform(255), uniform(255))
  167.         line bg rgb(uniform(255), uniform(255), uniform(255))
  168.         case i
  169.             when 1
  170.               call draw_box()
  171.             when 2
  172.               call draw_oval()
  173.             when 3
  174.               call draw_pie()
  175.             when 4
  176.               call draw_polygon()
  177.             when 5
  178.               call draw_spline()
  179.         end case
  180.     end for
  181. end repaint
  182. Chicago
  183. Chicago
  184. qg labels.  Uses the ImageWriter'
  185. drawings sheetd
  186. WZSSWNGZ
  187. WZSSWNGZ
  188.         
  189. authoritative information available on FileMake
  190. <Example of using a button in Wingz to produce line drawings.
  191. <Example of using a button in Wingz to produce line drawings.gs.
  192. &JSCeX
  193. StuffIt Description
  194. TeleFinder Description
  195.